* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

.left-sidebar {
  width: 200px;
  background-color: #374151;
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background-color: #6B7280;
  color: white;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #00d4aa;
}

.nav-item {
  position: relative;
}

.nav-icon {
  font-size: 1.1rem;
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - 200px - 280px); /* Subtract sidebar and chat widths */
  background-color: #f8f9fa;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.chat-assistant {
  width: 350px;
  min-width: 250px;
  max-width: 80vw;
  background-color: #f8f9fa;
  border-left: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
  overflow-x: hidden;
}

.resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: transparent;
  cursor: col-resize;
  z-index: 10;
}

.resize-handle:hover {
  background-color: #007bff;
}

.resize-handle.resizing {
  background-color: #007bff;
}
/* Ob
servability Platform Styles */
.observability-platform {
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex: 1;
  background-color: #f8f9fa;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0; /* Allow flex item to shrink below content size */
}

.platform-header {
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  color: white;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.header-content h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 600;
}

.header-content p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.connection-status-bar {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.connection-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.connection-label {
  font-weight: 600;
  color: #495057;
}

.connection-url {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: #495057;
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6c757d;
}

.connection-indicator.checking .status-dot {
  background-color: #dc3545;
  animation: pulse 1s infinite;
}

.connection-indicator.connected .status-dot {
  background-color: #28a745;
}

.connection-indicator.disconnected .status-dot {
  background-color: #dc3545;
}

.status-text {
  font-weight: 500;
  color: #495057;
}

.connection-indicator.connected .status-text {
  color: #28a745;
}

.connection-indicator.disconnected .status-text {
  color: #dc3545;
}

.retry-connection-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.retry-connection-btn:hover:not(:disabled) {
  background-color: #c82333;
}

.retry-connection-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.query-section {
  background-color: white;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 2rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.query-input-container {
  width: 100%;
}

.query-label {
  display: block;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.query-input-wrapper {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.query-input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
}

.query-input:focus {
  outline: none;
  border-color: #6B7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.query-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.execute-button {
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.execute-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 148, 133, 0.3);
}

.execute-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.clear-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clear-button:hover {
  background-color: #5a6268;
}

.query-hint {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

.results-section {
  flex: 1;
  padding: 1rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  color: #6c757d;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: #495057;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

.results-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-item {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.result-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-timestamp {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 400;
  background: rgba(108, 117, 125, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
}

.result-status {
  display: flex;
  align-items: center;
}

.status-success {
  background-color: #d4edda;
  color: #155724;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-loading {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-content {
  padding: 1.5rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #721c24;
  background-color: #f8d7da;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
}

.error-icon {
  font-size: 1.2rem;
}

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: #6c757d;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-top: 2px solid #6B7280;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.graph-container {
  background-color: #ffffff;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

/* Responsive design */
@media (max-width: 768px) {
  .platform-header {
    padding: 1.5rem 1rem;
  }

  .header-content h1 {
    font-size: 1.5rem;
  }

  .query-section {
    padding: 1rem;
  }

  .query-input-wrapper {
    flex-direction: column;
  }

  .results-section {
    padding: 1rem;
  }

  .result-header {
    padding: 0.5rem 1rem;
  }

  .result-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .result-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Error details styling */
.error-message {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-text {
  color: #dc3545;
  font-weight: 500;
}

.error-details {
  margin-top: 8px;
}

.error-details-label {
  color: #6c757d;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 8px;
}

.error-response-container {
  height: 200px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: auto;
}

.error-response {
  padding: 12px;
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85em;
  color: #495057;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 100%;
}

/* Maximize button and result actions */
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.maximize-button {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
  transition: all 0.2s ease;
}

.maximize-button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.maximize-button:active {
  transform: translateY(1px);
}

/* Graph modal overlay */
.graph-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.graph-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 95vw;
  height: 90vh;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.graph-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.graph-modal-title h3 {
  margin: 0 0 8px 0;
  color: #212529;
  font-size: 1.25rem;
  font-weight: 600;
}

.graph-modal-query {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 4px;
}

.graph-modal-query code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: #495057;
}

.close-modal-button {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.close-modal-button:hover {
  background: #e9ecef;
  color: #495057;
}

.graph-modal-content {
  flex: 1;
  padding: 20px 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.graph-modal-content .graph-visualization {
  flex: 1;
  min-height: 500px;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
  .graph-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
  }

  .graph-modal-overlay {
    padding: 0;
  }

  .graph-modal-header {
    padding: 16px 20px 12px;
  }

  .graph-modal-content {
    padding: 16px 20px;
  }
}

/* Keyboard navigation support */
.graph-modal-overlay:focus-within .close-modal-button {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* OpenSearch indices discovery */
.opensearch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.indices-button {
  background-color: #6B7280;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.indices-button:hover:not(:disabled) {
  background-color: #4B5563;
}

.indices-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.indices-display {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.indices-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.indices-header h4 {
  margin: 0;
  color: #495057;
  font-size: 1rem;
}

.close-indices-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #6c757d;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-indices-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.indices-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  padding: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.index-item {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: #495057;
  transition: all 0.2s ease;
}

.index-item:hover {
  background: #e9ecef;
  border-color: #6B7280;
  color: #212529;
  transform: translateY(-1px);
}

.indices-help {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.9rem;
  border-radius: 0 0 8px 8px;
}

/* Responsive indices display */
@media (max-width: 768px) {
  .indices-display {
    margin: 1rem;
  }

  .indices-list {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .indices-header {
    padding: 0.75rem 1rem;
  }

  .indices-help {
    padding: 0.75rem 1rem;
  }
}

/* Visualization container */
.visualization-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Unsupported data format styling */
.unsupported-data {
  text-align: center;
  padding: 2rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.unsupported-data .error-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.unsupported-data .error-text {
  font-size: 1.1rem;
  color: #856404;
  font-weight: 500;
  margin-bottom: 1rem;
}

.unsupported-data .error-details {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 1rem;
  text-align: left;
  max-height: 300px;
  overflow: auto;
}

.unsupported-data .error-details pre {
  margin: 0;
  font-size: 0.85rem;
  color: #495057;
}

/* Indices Discovery Section */
.indices-discovery-section {
  margin: 1rem 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.indices-discovery-header {
  margin-bottom: 1rem;
}

.indices-discovery-header h4 {
  margin: 0 0 0.5rem 0;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
}

.indices-discovery-header p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.show-indices-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  min-width: 200px;
  justify-content: center;
}

.show-indices-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.show-indices-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.show-indices-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.show-indices-btn:hover .dropdown-arrow {
  transform: translateY(1px);
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsive design for indices discovery */
@media (max-width: 768px) {
  .indices-discovery-section {
    margin: 1rem;
    padding: 1rem;
  }

  .indices-discovery-header h4 {
    font-size: 1rem;
  }

  .indices-discovery-header p {
    font-size: 0.85rem;
  }

  .show-indices-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    min-width: 180px;
  }
}

/* Arrow states for indices toggle */
.dropdown-arrow.up {
  transform: rotate(180deg);
}

.show-indices-btn:hover .dropdown-arrow.up {
  transform: rotate(180deg) translateY(-1px);
}

/* Visual feedback when indices are shown */
.show-indices-btn:has(.dropdown-arrow.up) {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.show-indices-btn:hover:has(.dropdown-arrow.up) {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Indices count styling */
.indices-count {
  color: #007bff;
  font-weight: 600;
  margin-left: 0.5rem;
}

.indices-count-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

/* Enhanced header styling when indices are loaded */
.indices-discovery-header h4:has(.indices-count) {
  color: #28a745;
}

/* Button state variations */
.show-indices-btn:has(.indices-count-badge) {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.show-indices-btn:hover:has(.indices-count-badge) {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

/* Responsive adjustments for count display */
@media (max-width: 768px) {
  .indices-count {
    font-size: 0.9rem;
  }

  .indices-count-badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.3rem;
  }
}

/* Indices Discovery Section - Compact Design */
.indices-discovery-section {
  margin: 0.5rem 2rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}

.indices-discovery-header {
  flex: 1;
  min-width: 0; /* Allow text to truncate */
}

.indices-discovery-header h4 {
  margin: 0 0 0.25rem 0;
  color: #495057;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.indices-discovery-header p {
  margin: 0;
  color: #6c757d;
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.show-indices-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 123, 255, 0.2);
  min-width: 160px;
  justify-content: center;
  flex-shrink: 0;
}

.show-indices-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.show-indices-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 123, 255, 0.2);
}

.show-indices-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.show-indices-btn:hover .dropdown-arrow {
  transform: translateY(1px);
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsive design for compact indices discovery */
@media (max-width: 768px) {
  .indices-discovery-section {
    margin: 0.5rem 1rem;
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    min-height: auto;
  }

  .indices-discovery-header h4 {
    font-size: 0.9rem;
  }

  .indices-discovery-header p {
    font-size: 0.75rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .show-indices-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    min-width: 140px;
    align-self: stretch;
  }
}

/* Brand credit styling */
.brand-title {
  position: relative;
  cursor: help;
  transition: all 0.3s ease;
}

.brand-credit {
  opacity: 0.6;
  font-size: 0.8rem;
  margin-left: 0.25rem;
  transition: all 0.3s ease;
}

.brand-title:hover {
  color: #007bff;
}

.brand-title:hover .brand-credit {
  opacity: 1;
  transform: scale(1.2);
}

/* Interactive tooltip for the credit */
.brand-tooltip {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.brand-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(0, 0, 0, 0.9);
}

.brand-title:hover .brand-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tooltip-text {
  color: #e0e0e0;
}

.github-link {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  position: relative;
}

.github-link:hover {
  color: #79c0ff;
  background: rgba(88, 166, 255, 0.1);
  text-decoration: underline;
}

.github-link:active {
  transform: scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .brand-title::after {
    font-size: 0.7rem;
    padding: 0.375rem 0.5rem;
    bottom: -32px;
  }
}

/* GitHub icon styling */
.github-icon {
  font-size: 0.7rem;
  margin-right: 0.25rem;
  transition: transform 0.2s ease;
}

.github-link:hover .github-icon {
  transform: scale(1.2);
}

/* Enhanced hover states */
.brand-title:hover {
  color: #007bff;
  cursor: help;
}

.brand-title:hover .brand-credit {
  opacity: 1;
  transform: scale(1.2) rotate(10deg);
}

/* Pulse animation for discoverability */
@keyframes subtle-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

.brand-credit {
  animation: subtle-pulse 3s ease-in-out infinite;
}

.brand-title:hover .brand-credit {
  animation: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .brand-tooltip {
    font-size: 0.7rem;
    padding: 0.375rem 0.5rem;
    bottom: -36px;
    max-width: 200px;
    text-align: center;
  }

  .github-link {
    padding: 0.1rem 0.2rem;
  }

  .github-icon {
    font-size: 0.65rem;
  }
}

/* Simple sidebar footer credit */
.sidebar-footer {
  position: absolute;
  bottom: calc(2rem + 20px);
  left: 0;
  right: 0;
  padding: 0 1rem;
  font-size: 0.7rem;
  color: white;
  line-height: 1.3;
}

.credit-text {
  color: white;
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.github-credit {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.9rem;
}

.github-credit:hover {
  color: #58a6ff;
}

.github-logo {
  fill: currentColor;
  transition: transform 0.2s ease;
  width: 14px;
  height: 14px;
}

.github-credit:hover .github-logo {
  transform: scale(1.1);
}

/* Disabled navigation item */
.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: #6c757d;
}

.nav-item.disabled:hover {
  background: transparent;
  color: #6c757d;
  transform: none;
}

.nav-item.disabled .nav-icon {
  opacity: 0.5;
}

/* Service icons for connection status */
.service-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Prometheus icon specific styling */
.connection-info img[alt="Prometheus"] {
  filter: brightness(1.1);
}

/* OpenSearch icon specific styling */
.connection-info img[alt="OpenSearch"] {
  border-radius: 2px;
}

/* Responsive adjustments for service icons */
@media (max-width: 768px) {
  .service-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.375rem;
  }
}

/* Floating maximize button overlay */
.maximize-button-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 16px;
  color: #495057;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.maximize-button-overlay:hover {
  background: #f8f9fa;
  border-color: #6B7280;
  color: #212529;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.maximize-button-overlay:active {
  transform: translateY(0);
}

/* Ensure visualization container has relative positioning */
.visualization-container {
  position: relative;
  width: 100%;
}

/* Query label row with inline hint */
.query-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Query hint inline with label */
.query-hint-inline {
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .query-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .query-hint-inline {
    font-size: 0.7rem;
  }
}

/* Prometheus Series Explorer - Three-box interface */
.prometheus-explorer {
  margin: 1rem 2rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.explorer-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.explorer-header:hover {
  background: #e9ecef;
}

.explorer-title {
  width: 100%;
}

.explorer-title h4 {
  margin: 0 0 0.25rem 0;
  color: #495057;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.explorer-title p {
  margin: 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.toggle-icon {
  font-size: 0.8rem;
  color: #6c757d;
  transition: transform 0.2s ease;
}

.series-count-pill {
  background: #007bff;
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.5rem;
  margin-right: 0.25rem;
}

.explorer-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: #e9ecef;
}

.explorer-box {
  background: white;
  display: flex;
  flex-direction: column;
  min-height: 225px;
  max-height: 300px;
}

.box-header {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.box-header h5 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

.box-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.explorer-item {
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  color: #495057;
  transition: all 0.2s ease;
  word-break: break-all;
}

.explorer-item:hover {
  background: #e9ecef;
  border-color: #6B7280;
  color: #212529;
  transform: translateY(-1px);
}

.explorer-item.selected {
  background: #007bff;
  border-color: #0056b3;
  color: white;
}

.explorer-item.selected:hover {
  background: #0056b3;
  border-color: #004085;
}

.empty-box {
  padding: 2rem 1rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  font-size: 0.85rem;
}

/* Responsive design for explorer */
@media (max-width: 1024px) {
  .explorer-boxes {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .explorer-box {
    min-height: 150px;
    max-height: 188px;
  }

  .prometheus-explorer {
    margin: 1rem;
  }
}

@media (max-width: 768px) {
  .explorer-header {
    padding: 0.75rem 1rem;
  }

  .explorer-title h4 {
    font-size: 0.9rem;
  }

  .explorer-title p {
    font-size: 0.8rem;
  }

  .toggle-icon {
    font-size: 0.7rem;
  }

  .series-count-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.375rem;
    margin-left: 0.375rem;
    margin-right: 0.2rem;
  }

  .box-header {
    padding: 0.5rem 0.75rem;
  }

  .explorer-item {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
  }
}

/* OpenSearch single-box layout */
.opensearch-single-box {
  grid-column: 1 / -1; /* Span all columns */
}

/* Adjust grid for single box when it's OpenSearch */
.explorer-boxes:has(.opensearch-single-box) {
  grid-template-columns: 1fr;
}

/* Alternative approach for better browser support */
.explorer-boxes.single-box {
  grid-template-columns: 1fr;
}

/* Query helper text */
.query-helper-text {
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

/* Responsive adjustments for helper text */
@media (max-width: 768px) {
  .query-helper-text {
    font-size: 0.75rem;
    margin-top: 0.375rem;
  }
}
